package com.fastwire.carriere.service.dataconverter;

import java.util.List;
import java.util.Set;

import com.fastwire.carriere.inventory.entity.CrossConnect;
import com.fastwire.carriere.inventory.entity.FDFr;
import com.fastwire.carriere.inventory.entity.NetworkElement;
import com.fastwire.carriere.inventory.vo.CrossConnectVo;
import com.fastwire.carriere.inventory.vo.FDFrVo;
import com.fastwire.carriere.inventory.vo.NetworkElementVo;
import com.fastwire.carriere.user.entity.Permission;
import com.fastwire.carriere.user.vo.PermissionVo;
import com.google.common.collect.Lists;

// TODO: Auto-generated Javadoc
/**
 * The Class ViewObjectConverter.
 */
public class ViewObjectConverter {

	/**
	 * Convert to fd fr vos.
	 * 
	 * @param fdfrs
	 *            the fdfrs
	 * @return the list
	 */
	public static List<FDFrVo> convertToFdFrVos(List<FDFr> fdfrs) {
		List<FDFrVo> fdFrVos = Lists.newArrayList();
		for (FDFr fdfr : fdfrs) {
			fdFrVos.add(new FDFrVo(fdfr));
		}

		return fdFrVos;

	}

	/**
	 * Convert to ne vos.
	 * 
	 * @param neList
	 *            the ne list
	 * @return the list
	 */
	public static List<NetworkElementVo> convertToNEVos(
			List<NetworkElement> neList) {
		List<NetworkElementVo> fdFrVos = Lists.newArrayList();
		for (NetworkElement ne : neList) {
			fdFrVos.add(new NetworkElementVo(ne));
		}

		return fdFrVos;

	}

	/**
	 * Convert to cross connect vos.
	 * 
	 * @param ccList
	 *            the cc list
	 * @return the list
	 */
	public static List<CrossConnectVo> convertToCrossConnectVos(
			List<CrossConnect> ccList) {
		List<CrossConnectVo> ccVos = Lists.newArrayList();
		for (CrossConnect cc : ccList) {
			ccVos.add(new CrossConnectVo(cc));
		}

		return ccVos;

	}

	/**
	 * Convert to permission vos.
	 * 
	 * @param permissions
	 *            the permissions
	 * @return the list
	 */
	public static List<PermissionVo> convertToPermissionVos(
			Set<Permission> permissions) {
		List<PermissionVo> ccVos = Lists.newArrayList();
		for (Permission cc : permissions) {
			ccVos.add(new PermissionVo(cc));
		}

		return ccVos;

	}

}
